<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
		<script type="text/javascript">
			window.onload = function(){
				//为两个按钮绑定单击响应函数
				var btn01 = document.getElementById("btn01");
				var btn02 = document.getElementById("btn02");
				btn01.onclick = function(){
					alert(1);
				}
				btn02.onclick = function(){
					alert(2);
				}
				btn01.setCapture();
			};
		</script>
		
	</head>
	<body>
		<button id="btn01">按钮1</button>
		<button id="btn02">按钮2</button>
	</body>
</html>